
#include "driver_audio.h"
#include "driver_sample.h"
#include "driver_hdec.h"
#include "sys_types.h"

#ifdef _WIN32
#define AUDIO_DRIVER_EN 1
#define SAMPLE_DRIVER_EN 1
#define HDEC_DRIVER_EN  1
#endif

void register_drivers()
{
	//register_chrdev(&g_pmu_dev_description);
#if TIMER_DRIVER_EN
    register_chrdev(&g_timer_dev_description);
#endif
#if AUDIO_DRIVER_EN
    register_chrdev(&g_audio0_dev_description);
	register_chrdev(&g_audio1_dev_description);
#endif
#if SD_DRIVER_EN
    register_chrdev(&g_sd_dev_description);
#endif
#if LCD_DRIVER_EN
	register_chrdev(&g_lcd_dev_description);
#endif
#if TP_DRIVER_EN
    register_chrdev(&g_tp_dev_description);
#endif
#if USBD_DRIVER_EN
    register_chrdev(&g_usbd_dev_description);
#endif
#if TIMER_DRIVER_EN
	register_chrdev(&g_timer_dev_description);
#endif
#if RTC_DRIVER_EN
	register_chrdev(&g_rtc_dev_description);
#endif
#if WATCH_DOG_DRIVER_EN
	register_chrdev(&g_wdog_dev_description);
#endif
#if PWM_CH3_DRIVER_EN
	register_chrdev(&g_pwm_ch3_dev_description);
#endif
#if EXTI_DRIVER_EN
	register_chrdev(&g_exti_dev_description);
#endif
#if FM_DRIVER_EN
	register_chrdev(&g_fm_dev_description);
#endif
#if (KEY_DRIVER_EN && KEY_ADC_DRIVER_EN)
#if KEY_ADC_CH0_DRIVER_EN
    register_chrdev(&g_key_adc_ch0_dev_description);
#endif
#if KEY_ADC_CH1_DRIVER_EN
    register_chrdev(&g_key_adc_ch1_dev_description);
#endif
#if KEY_ADC_CH2_DRIVER_EN
    register_chrdev(&g_key_adc_ch2_dev_description);
#endif
#if KEY_ADC_CH3_DRIVER_EN
    register_chrdev(&g_key_adc_ch3_dev_description);
#endif
#if KEY_ADC_CH4_DRIVER_EN
    register_chrdev(&g_key_adc_ch4_dev_description);
#endif
#if KEY_ADC_CH5_DRIVER_EN
    register_chrdev(&g_key_adc_ch5_dev_description);
#endif
#endif
#if KEY_ONOFF_DRIVER_EN
    register_chrdev(&g_key_onoff_dev_description);
#endif
#if KEY_IO_DRIVER_EN
    register_chrdev(&g_key_io_dev_description);
#endif
#if SAMPLE_DRIVER_EN
    register_chrdev(&g_sample_dev_description);
#endif
#if HDEC_DRIVER_EN
    register_chrdev(&g_hdec_dev_description);
#endif
}

void unregister_drivers()
{
#if TIMER_DRIVER_EN
    unregister_chrdev(&g_timer_dev_description);
#endif
#if AUDIO_DRIVER_EN
    unregister_chrdev(&g_audio0_dev_description);
    unregister_chrdev(&g_audio1_dev_description);
#endif
#if SD_DRIVER_EN
    unregister_chrdev(&g_sd_dev_description);
#endif
#if LCD_DRIVER_EN
    unregister_chrdev(&g_lcd_dev_description);
#endif
#if TP_DRIVER_EN
    unregister_chrdev(&g_tp_dev_description);
#endif
#if USBD_DRIVER_EN
    unregister_chrdev(&g_usbd_dev_description);
#endif
#if TIMER_DRIVER_EN
    unregister_chrdev(&g_timer_dev_description);
#endif
#if RTC_DRIVER_EN
    unregister_chrdev(&g_rtc_dev_description);
#endif
#if WATCH_DOG_DRIVER_EN
    unregister_chrdev(&g_wdog_dev_description);
#endif
#if PWM_CH3_DRIVER_EN
    unregister_chrdev(&g_pwm_ch3_dev_description);
#endif
#if EXTI_DRIVER_EN
    unregister_chrdev(&g_exti_dev_description);
#endif
#if FM_DRIVER_EN
    unregister_chrdev(&g_fm_dev_description);
#endif
#if (KEY_DRIVER_EN && KEY_ADC_DRIVER_EN)
#if KEY_ADC_CH0_DRIVER_EN
    unregister_chrdev(&g_key_adc_ch0_dev_description);
#endif
#if KEY_ADC_CH1_DRIVER_EN
    unregister_chrdev(&g_key_adc_ch1_dev_description);
#endif
#if KEY_ADC_CH2_DRIVER_EN
    unregister_chrdev(&g_key_adc_ch2_dev_description);
#endif
#if KEY_ADC_CH3_DRIVER_EN
    unregister_chrdev(&g_key_adc_ch3_dev_description);
#endif
#if KEY_ADC_CH4_DRIVER_EN
    unregister_chrdev(&g_key_adc_ch4_dev_description);
#endif
#if KEY_ADC_CH5_DRIVER_EN
    unregister_chrdev(&g_key_adc_ch5_dev_description);
#endif
#endif
#if KEY_ONOFF_DRIVER_EN
    unregister_chrdev(&g_key_onoff_dev_description);
#endif
#if KEY_IO_DRIVER_EN
    unregister_chrdev(&g_key_io_dev_description);
#endif
#if SAMPLE_DRIVER_EN
    unregister_chrdev(&g_sample_dev_description);
#endif
#if HDEC_DRIVER_EN
    unregister_chrdev(&g_hdec_dev_description);
#endif
}